package com.catchegg.springcloud.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

/**
 * @author noreply
 * @description
 * @datetime 2021/11/2 22:48
 */
@RestController
@RequestMapping("consumer")
public class OrderConsulController {

    @Resource
    private RestTemplate restTemplate;

    public static final String PAYMENT_URL = "http://consul-provider-payment";

    @GetMapping("payment/consul")
    public String getPaymentInfo() {
        String res = restTemplate.getForObject(PAYMENT_URL + "/payment/consul", String.class);
        return res;
    }
}
